<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><spring:message code="create_fashion_style"/></title>
    <script src="${ctxStatic}/jquery/jquery-1.9.1.min.js"></script>
    <%@ include file="/WEB-INF/views/include/CustomizationQualityEnter_head.jsp"%>
    <script src="${ctxStatic}/jquery/keyboard.js"></script>
    <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
    <link rel="stylesheet" href="${ctxStatic}/css/keyboard_style.css">
    <script src="${ctxStatic}/layDate/laydate.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
        $("#write").focus();
    	var form = $("#inputForm");
        form.validate();//验证指定的表单
   		$("#searchBtn").click(function(){
    		if (form.valid()) {//如果表单验证成功，则进行提交。
    			selectOrder();
    		}
            return false;
     	});
   	});
        function selectOrder() {
            var operatingId = $("#operatingId").val();
            var barCode = $("#write").val();
            var param = {
                "barCode":barCode,
                "writeKbn":"2",
                "itemId":operatingId
            };
            $.post("${ctx}/customization/quality/checkExist",param,function(result){
                var status = result["flg"];
                var orderCd = result["strOrderNo"];
                if (status=="true") {
                    window.location.href = "${ctx}/customization/quality/searchList?orderCd="+orderCd+"&itemId="+operatingId +"&barCode="+barCode;
                } else {
                    alert("<spring:message code="customization_message_unexist"/>");
                    $("#write").focus();
                }
            },'json');
        	/* var param = {
                "orderCd":orderCd,
        	    "writeKbn":"1",
                 "itemId":operatingId
        	};
        	$.post("${ctx}/customization/quality/checkExist",param,function(result){
    			if (result==true) {
    				window.location.href = "${ctx}/customization/quality/searchList?orderCd="+orderCd+"&itemId="+operatingId;
				}else{
					alert("<spring:message code="customization_message_unexist"/>");
                    $("#write").focus();
				}
    		},'json'); */
        }
        //var count = 1;
        function  keyLogin(e) {
        	//alert(e.key);
        	
        	
            var theEvent = window.event || e;
            var code = theEvent.keyCode || theEvent.which;
            var operatingId = $("#operatingId").val();
            if (e.key=='Enter') {
                var barCode = $("#write").val();
                var param = {
                    "barCode":barCode,
                    "writeKbn":"2",
                    "itemId":operatingId
                };
                $.post("${ctx}/customization/quality/checkExist",param,function(result){
                    var status = result["flg"];
                    var orderCd = result["strOrderNo"];
                    if (status=="true") {
                        window.location.href = "${ctx}/customization/quality/searchList?orderCd="+orderCd+"&itemId="+operatingId;
                    } else {
                        alert("<spring:message code="customization_message_unexist"/>");
                        $("#write").focus();
                    }
                },'json');
            }
            
        }
        // 返回
        function goBackHtmlTemp() {
        	window.location.href="${ctx}/customization/quality/buttonEnter";
		}
    </script>
    <style>
        .btnTemp {
            float: right;
            margin:-4px 18px 5px 1px;
            width: 80px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            background: #8b9588;
            border: 1px solid #f9f9f9;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            font-size:17px;
            color:#0c0c0b;
        }
        .btnTemp:hover {
            position: relative;
            top: 1px;
            left: 1px;
            border-color: #e5e5e5;
            cursor: pointer;
        }

        .btnTemp:active {
            position:relative;
            top:1px;
        }

        .col-16{
            width:33%;
            float:left;
        }
        .col-50{
            width:50%;
            float:left;
        }
        .label_css {
            width:100px;
            float:none;
            display: inline-block;
            font-size:19px;
        }
    </style>
</head>
<body>
<form id="inputForm" onkeydown="if(event.keyCode==13){return false;}">
    <input type="hidden" id="operatingId" value="${operatingId}" >
    <div class="tabBoxSm">
        <div class="tabSm smOrderBox" style ="width:750px">
            <div class="items clearfix">
                <div class="col-50 clearfix">
                    <c:choose>
                        <c:when test="${operatingId == '37'}">
                            <strong style="font-size:15px;"><spring:message code="customization_quality01"/></strong>
                        </c:when>
                        <c:when test="${operatingId == '36'}">
                            <strong style="font-size:15px;"><spring:message code="customization_quality02"/></strong>
                        </c:when>
                        <c:when test="${operatingId == '35'}">
                            <strong style="font-size:15px;"><spring:message code="customization_quality03"/></strong>
                        </c:when>
                        <c:otherwise>
                            <strong style="font-size:15px;"><spring:message code="customization_quality04"/></strong>
                        </c:otherwise>
                        </c:choose>
                </div>
        </div>
                <div class="user" style="right: 5px;width: 200px;position: absolute;top:5px;font-size: 13px;">
                <div class="userNzme" style="float: left;top:5px;position: relative;margin-right: 3px;">
			        <span>${user}</span>
			        <span>${fns:getDate('yyyy-MM-dd')}</span>
			    </div>
	                <div class="out">
		            <img src="${ctxStatic}/images/icon-out.png">
		            <span ><a href="${ctx}/logout" title="<spring:message code="index_log_out"/>"><spring:message code="index_exit"/></a></span>
	        	</div>
            </div>
            <div class="items clearfix" style="margin-top: 20px;">
                <div class="col-16 clearfix" style="text-align:right;width:100px;">
                    <label class="label_css"><spring:message code="order_orderNo"/>：</label>
                </div>
                <div class="col-16 clearfix">
                    <input type="text" id="write" name="orderCd" onkeydown="keyLogin(event);"  onfocus="javascript:this.select();" style="width: 230px" data-rule-required="true" data-msg-required="<spring:message code="customization_please_input_styleNo"/>">
                    <div id="container">
                        <ul id="keyboard">
                            <li class="symbol"><span class="off">`</span><span class="on">~</span></li>
                            <li class="symbol"><span class="off">1</span><span class="on">!</span></li>
                            <li class="symbol"><span class="off">2</span><span class="on">@</span></li>
                            <li class="symbol"><span class="off">3</span><span class="on">#</span></li>
                            <li class="symbol"><span class="off">4</span><span class="on">$</span></li>
                            <li class="symbol"><span class="off">5</span><span class="on">%</span></li>
                            <li class="symbol"><span class="off">6</span><span class="on">^</span></li>
                            <li class="symbol"><span class="off">7</span><span class="on">&amp;</span></li>
                            <li class="symbol"><span class="off">8</span><span class="on">*</span></li>
                            <li class="symbol"><span class="off">9</span><span class="on">(</span></li>
                            <li class="symbol"><span class="off">0</span><span class="on">)</span></li>
                            <li class="symbol"><span class="off">-</span><span class="on">_</span></li>
                            <li class="symbol"><span class="off">=</span><span class="on">+</span></li>
                            <li class="delete lastitem">delete</li>
                            <li class="tab">tab</li>
                            <li class="letter">q</li>
                            <li class="letter">w</li>
                            <li class="letter">e</li>
                            <li class="letter">r</li>
                            <li class="letter">t</li>
                            <li class="letter">y</li>
                            <li class="letter">u</li>
                            <li class="letter">i</li>
                            <li class="letter">o</li>
                            <li class="letter">p</li>
                            <li class="symbol"><span class="off">[</span><span class="on">{</span></li>
                            <li class="symbol"><span class="off">]</span><span class="on">}</span></li>
                            <li class="symbol lastitem"><span class="off">\</span><span class="on">|</span></li>
                            <li class="capslock">caps lock</li>
                            <li class="letter">a</li>
                            <li class="letter">s</li>
                            <li class="letter">d</li>
                            <li class="letter">f</li>
                            <li class="letter">g</li>
                            <li class="letter">h</li>
                            <li class="letter">j</li>
                            <li class="letter">k</li>
                            <li class="letter">l</li>
                            <li class="symbol"><span class="off">;</span><span class="on">:</span></li>
                            <li class="symbol"><span class="off">'</span><span class="on">&quot;</span></li>
                            <li class="return lastitem">return</li>
                            <li class="left-shift">shift</li>
                            <li class="letter">z</li>
                            <li class="letter">x</li>
                            <li class="letter">c</li>
                            <li class="letter">v</li>
                            <li class="letter">b</li>
                            <li class="letter">n</li>
                            <li class="letter">m</li>
                            <li class="symbol"><span class="off">,</span><span class="on">&lt;</span></li>
                            <li class="symbol"><span class="off">.</span><span class="on">&gt;</span></li>
                            <li class="symbol"><span class="off">/</span><span class="on">?</span></li>
                            <li class="right-shift lastitem">shift</li>
                            <li class="space lastitem">&nbsp;</li>
                        </ul>
                    </div>
                </div>
                <div class="col-16 clearfix">
                    <img src="${ctxStatic}/images/cq.png" alt="" style="width: 30px;height:30px"/>
                    <button class="btnTemp" style="float:right;" type="button" onclick="goBackHtmlTemp();"><spring:message code="quotation_create_back"/></button>
                    <button id="searchBtn" type="button" class="btnTemp"><spring:message code="quotation_create_ok"/></button>
                    
                </div>
            </div>
        </div>
    </div>
</form>
</body>
</html>
